﻿/*
Wrtiten by Webmaster442 (c) 2009
Uses The ICSharpCode.SharpZLib zip compression module
This is free software. License: GPL V2
*/
using System;
using System.Windows.Forms;

namespace loader
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        public static bool needtoquit;
        public static loc localee;

        [STAThread]
        static void Main(string[] param)
        {
            localee = new loc();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            needtoquit = false;
            if (param.Length > 0)
            {
                switch (param[0])
                {
                    case "--extract":
                        extractfiles ex = new extractfiles();
                        if (param.Length > 1) ex.Path = param[1];
                        if (!needtoquit) Application.Run(ex);
                        else Application.Exit();
                        break;
                    case "--help":
                    case "/?":
                        MessageBox.Show(localee["param_help"].Replace("\\n", "\n"), localee["iform_txt"], MessageBoxButtons.OK, MessageBoxIcon.Information);
                        Application.Exit();
                        break;
                    default:
                        MessageBox.Show(localee["param_invalid"], localee["error_txt"], MessageBoxButtons.OK, MessageBoxIcon.Error);
                        Application.Exit();
                        break;
                }
            }
            else
            {
                load loader = new load();
                if (!needtoquit) Application.Run(loader);
                else Application.Exit();
            }

        }
    }
}
